/*
 * Decompiled with CFR 0.150.
 * 
 * Could not load the following classes:
 *  cn.hutool.core.collection.CollUtil
 *  cn.hutool.core.date.DateUtil
 *  cn.hutool.core.util.ObjectUtil
 *  cn.hutool.core.util.StrUtil
 *  com.alibaba.fastjson.JSON
 *  com.alibaba.fastjson.JSONObject
 *  de.felixroske.jfxsupport.FXMLController
 *  javafx.beans.value.ChangeListener
 *  javafx.beans.value.ObservableValue
 *  javafx.collections.FXCollections
 *  javafx.collections.ObservableList
 *  javafx.event.EventHandler
 *  javafx.fxml.FXML
 *  javafx.fxml.Initializable
 *  javafx.geometry.Insets
 *  javafx.scene.Node
 *  javafx.scene.control.Alert
 *  javafx.scene.control.Alert$AlertType
 *  javafx.scene.control.CheckBox
 *  javafx.scene.control.ChoiceBox
 *  javafx.scene.control.DatePicker
 *  javafx.scene.control.Pagination
 *  javafx.scene.control.ScrollPane
 *  javafx.scene.control.TableCell
 *  javafx.scene.control.TableColumn
 *  javafx.scene.control.TableView
 *  javafx.scene.control.TextField
 *  javafx.scene.control.cell.PropertyValueFactory
 *  javafx.scene.input.KeyCode
 *  javafx.scene.input.KeyEvent
 *  javafx.scene.layout.VBox
 *  javafx.stage.Modality
 *  javafx.util.Callback
 *  javafx.util.StringConverter
 *  org.springframework.beans.factory.annotation.Autowired
 *  org.springframework.util.CollectionUtils
 */
package com.gys.controller.deviceCheck;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gys.GysApplication;
import com.gys.common.business.DeviceCheckUtil;
import com.gys.common.data.HttpJson;
import com.gys.common.data.PageInfo;
import com.gys.common.util.CommonUtil;
import com.gys.common.util.ConstUtil;
import com.gys.controller.BaseController;
import com.gys.controller.deviceCheck.AddDeviceCheckController;
import com.gys.controller.deviceCheck.EditDeviceCheckController;
import com.gys.controller.index.IndexController;
import com.gys.data.deviceCheck.DeviceCheckInData;
import com.gys.data.deviceCheck.DeviceCheckOutData;
import com.gys.data.deviceCheck.GsdcStatus;
import com.gys.view.deviceCheck.AddView;
import com.gys.view.deviceCheck.EditView;
import de.felixroske.jfxsupport.FXMLController;
import java.net.URL;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.ResourceBundle;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.geometry.Insets;
import javafx.scene.Node;
import javafx.scene.control.Alert;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.DatePicker;
import javafx.scene.control.Pagination;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.VBox;
import javafx.stage.Modality;
import javafx.util.Callback;
import javafx.util.StringConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;

@FXMLController
public class DeviceCheckController
extends BaseController
implements Initializable {
    private final int pageSize = ConstUtil.DEFAULT_PAGESIZE;
    private final int defaultPageCount = ConstUtil.DEFAULT_PAGECOUNT;
    private ObservableList<DeviceCheckOutData> observableTableList = FXCollections.observableArrayList(new ArrayList());
    @FXML
    private ScrollPane scrollPane;
    @FXML
    private VBox vBox;
    @FXML
    private TextField voucherIdQuery;
    @FXML
    private ChoiceBox<GsdcStatus> statusQuery;
    @FXML
    private DatePicker updateDateQuery;
    @FXML
    private TableView<DeviceCheckOutData> tableView;
    @FXML
    private TableColumn<DeviceCheckOutData, CheckBox> checkBox;
    @FXML
    private TableColumn<DeviceCheckOutData, String> index;
    @FXML
    private TableColumn<DeviceCheckOutData, String> gsdcVoucherId;
    @FXML
    private TableColumn<DeviceCheckOutData, String> gsdcBrId;
    @FXML
    private TableColumn<DeviceCheckOutData, String> gsdcBrName;
    @FXML
    private TableColumn<DeviceCheckOutData, String> gsdcDeviceId;
    @FXML
    private TableColumn<DeviceCheckOutData, String> gsdcDeviceName;
    @FXML
    private TableColumn<DeviceCheckOutData, String> gsdcDeviceModel;
    @FXML
    private TableColumn<DeviceCheckOutData, String> gsdcCheckRemarks;
    @FXML
    private TableColumn<DeviceCheckOutData, String> gsdcCheckResult;
    @FXML
    private TableColumn<DeviceCheckOutData, String> gsdcCheckStep;
    @FXML
    private TableColumn<DeviceCheckOutData, String> gsdcUpdateEmp;
    @FXML
    private TableColumn<DeviceCheckOutData, String> gsdcUpdateDate;
    @FXML
    private TableColumn<DeviceCheckOutData, String> gsdcUpdateTime;
    @FXML
    private TableColumn<DeviceCheckOutData, String> gsdcStatus;
    @FXML
    private Pagination pagination;
    @FXML
    private Insets tableViewInsets;
    @Autowired
    private IndexController indexController;
    @Autowired
    private AddDeviceCheckController addDeviceCheckController;
    @Autowired
    private EditDeviceCheckController editDeviceCheckController;
    private DeviceCheckOutData selectedCheckOutData = new DeviceCheckOutData();

    public void initialize(URL location, ResourceBundle resources) {
        this.scrollPane.setPrefWidth(this.getContentWidth());
        this.scrollPane.setPrefHeight(this.getContentHeight());
        this.vBox.setPrefWidth(this.getContentWidth());
        this.vBox.setPrefHeight(this.getContentHeight());
        this.tableView.setPrefWidth(this.getContentWidth());
        this.pagination.setPrefWidth(this.getContentWidth());
        this.statusQuery.getItems().addAll(this.getAllStatus());
        this.statusQuery.converterProperty().set(new StringConverter<GsdcStatus>(){

            public String toString(GsdcStatus object) {
                return object.getName();
            }

            public GsdcStatus fromString(String string) {
                return null;
            }
        });
        StringConverter converter = CommonUtil.dataPickerFormat("yyyyMMdd");
        this.updateDateQuery.setConverter(converter);
        this.pagination.setPageFactory((Callback)new Callback<Integer, Node>(){

            public Node call(Integer pageNum) {
                return DeviceCheckController.this.initTable(pageNum);
            }
        });
        this.init();
    }

    @Override
    public void init() {
        this.indexController.scrollContentPane.setOnKeyReleased((EventHandler)new EventHandler<KeyEvent>(){

            public void handle(KeyEvent event) {
                if (event.getCode() == KeyCode.F1) {
                    DeviceCheckController.this.openAdd();
                    return;
                }
                if (event.getCode() == KeyCode.F3) {
                    DeviceCheckController.this.openEdit();
                    return;
                }
                if (event.getCode() == KeyCode.F8) {
                    DeviceCheckController.this.approve();
                    return;
                }
                if (event.getCode() == KeyCode.ENTER) {
                    DeviceCheckController.this.searchData();
                }
            }
        });
    }

    @FXML
    private void searchData() {
        String voucherId = this.voucherIdQuery.getText().trim();
        String status = "";
        if (ObjectUtil.isNotNull(this.statusQuery.getValue())) {
            status = ((GsdcStatus)this.statusQuery.getValue()).getCode();
        }
        LocalDate updateDate = (LocalDate)this.updateDateQuery.getValue();
        Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", null);
        if (StrUtil.isBlank((CharSequence)voucherId) && StrUtil.isBlank((CharSequence)status) && ObjectUtil.isNull(updateDate)) {
            alert.setContentText("\u5fc5\u987b\u81f3\u5c11\u586b\u5199\u4e00\u9879\u5185\u5bb9\u8fdb\u884c\u67e5\u8be2\uff01");
            alert.showAndWait();
            return;
        }
        this.initTable(0);
        this.pagination.setCurrentPageIndex(0);
    }

    @FXML
    private void openAdd() {
        this.addDeviceCheckController.init();
        GysApplication.showView(AddView.class, (Modality)Modality.APPLICATION_MODAL);
    }

    @FXML
    private void openEdit() {
        Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", null);
        List<Integer> indexList = this.getSelectIndex();
        if (ObjectUtil.isEmpty(indexList)) {
            alert.setContentText("\u8bf7\u9009\u62e9\u8bb0\u5f55");
            alert.showAndWait();
            return;
        }
        this.selectedCheckOutData = (DeviceCheckOutData)this.observableTableList.get(indexList.get(0) - 1);
        if (!"\u672a\u5ba1\u6838".equals(this.selectedCheckOutData.getGsdcStatus())) {
            alert.setContentText("\u53ea\u80fd\u4fee\u6539\u672a\u5ba1\u6838\u72b6\u6001\u7684\u8bb0\u5f55");
            alert.showAndWait();
            return;
        }
        this.editDeviceCheckController.init();
        GysApplication.showView(EditView.class, (Modality)Modality.APPLICATION_MODAL);
    }

    @FXML
    private void approve() {
        Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", null);
        List<Integer> indexList = this.getSelectIndex();
        if (ObjectUtil.isEmpty(indexList)) {
            alert.setContentText("\u8bf7\u9009\u62e9\u8bb0\u5f55");
            alert.showAndWait();
            return;
        }
        ArrayList<String> gsdcVoucherIds = new ArrayList<String>();
        for (Integer index : indexList) {
            DeviceCheckOutData deviceCheckOutData = (DeviceCheckOutData)this.observableTableList.get(index - 1);
            gsdcVoucherIds.add(deviceCheckOutData.getGsdcVoucherId());
        }
        DeviceCheckInData inData = new DeviceCheckInData();
        inData.setGsdcVoucherIds(gsdcVoucherIds);
        HttpJson rsp = DeviceCheckUtil.approve(inData);
        if (rsp.isSuccess()) {
            alert.setContentText("\u5ba1\u6838\u6210\u529f!");
            alert.showAndWait();
            this.initTable(this.pagination.getCurrentPageIndex());
        } else {
            alert.setContentText(rsp.getMsg());
            alert.showAndWait();
        }
    }

    public TableView<DeviceCheckOutData> initTable(int pageNum) {
        List<DeviceCheckOutData> dataList;
        PageInfo pageInfo;
        HttpJson rsp;
        DeviceCheckInData inData = new DeviceCheckInData();
        inData.setPageNum(pageNum + 1);
        inData.setPageSize(this.pageSize);
        inData.setGsdcVoucherId(this.voucherIdQuery.getText().trim());
        if (ObjectUtil.isNotNull(this.statusQuery.getValue())) {
            inData.setGsdcStatus(((GsdcStatus)this.statusQuery.getValue()).getCode());
        }
        if (ObjectUtil.isNotNull(this.updateDateQuery.getValue())) {
            inData.setGsdcUpdateDate(DateUtil.format((Date)DateUtil.parse((String)((LocalDate)this.updateDateQuery.getValue()).toString()), (String)"yyyyMMdd"));
        }
        if ((rsp = DeviceCheckUtil.selectList(inData)).isSuccess()) {
            pageInfo = (PageInfo)JSON.parseObject((String)rsp.getMsg(), PageInfo.class);
            if (pageInfo != null && CollUtil.isNotEmpty(pageInfo.getList())) {
                ArrayList<DeviceCheckOutData> listTemp = new ArrayList<DeviceCheckOutData>();
                for (int i = 0; i < pageInfo.getList().size(); ++i) {
                    String str = JSONObject.toJSONString(pageInfo.getList().get(i));
                    DeviceCheckOutData outData = (DeviceCheckOutData)JSONObject.parseObject((String)str, DeviceCheckOutData.class);
                    if ("1".equals(outData.getGsdcStatus())) {
                        outData.setGsdcStatus("\u5df2\u5ba1\u6838");
                    } else {
                        outData.setGsdcStatus("\u672a\u5ba1\u6838");
                    }
                    outData.setIndex(i + 1);
                    listTemp.add(outData);
                }
                pageInfo.setList(listTemp);
            }
        } else {
            Alert alert = this.createAlert(Alert.AlertType.INFORMATION, "\u63d0\u793a\u4fe1\u606f", rsp.getMsg());
            alert.showAndWait();
            return new TableView();
        }
        if (pageInfo != null && CollUtil.isNotEmpty(pageInfo.getList())) {
            this.pagination.setPageCount(pageInfo.getPages());
            dataList = pageInfo.getList();
        } else {
            this.pagination.setPageCount(this.defaultPageCount);
            dataList = new ArrayList();
        }
        this.observableTableList.clear();
        this.observableTableList = FXCollections.observableArrayList(dataList);
        this.bingTableCell();
        this.tableView.setItems(this.observableTableList);
        return this.tableView;
    }

    private void bingTableCell() {
        this.index.setCellValueFactory((Callback)new PropertyValueFactory(this.index.getId()));
        this.checkBox.setCellValueFactory(cellData -> ((DeviceCheckOutData)cellData.getValue()).getCheckBox().getCustomCheckBox());
        this.checkBox.setCellFactory(col -> {
            TableCell<DeviceCheckOutData, CheckBox> cell = new TableCell<DeviceCheckOutData, CheckBox>(){

                protected void updateItem(CheckBox item, boolean empty) {
                    super.updateItem(item, empty);
                    this.setGraphic((Node)item);
                    if (item != null) {
                        item.setOnMouseClicked(col -> {
                            if (CollUtil.isEmpty((Collection)DeviceCheckController.this.observableTableList)) {
                                return;
                            }
                            int index = this.getIndex();
                            for (int i = 0; i < DeviceCheckController.this.observableTableList.size(); ++i) {
                                if (i == index) continue;
                                ((DeviceCheckOutData)DeviceCheckController.this.observableTableList.get(i)).getCheckBox().setSelectStatus(false);
                            }
                        });
                    }
                }
            };
            return cell;
        });
        this.gsdcVoucherId.setCellValueFactory((Callback)new PropertyValueFactory(this.gsdcVoucherId.getId()));
        this.gsdcBrId.setCellValueFactory((Callback)new PropertyValueFactory(this.gsdcBrId.getId()));
        this.gsdcBrName.setCellValueFactory((Callback)new PropertyValueFactory(this.gsdcBrName.getId()));
        this.gsdcDeviceId.setCellValueFactory((Callback)new PropertyValueFactory(this.gsdcDeviceId.getId()));
        this.gsdcDeviceName.setCellValueFactory((Callback)new PropertyValueFactory(this.gsdcDeviceName.getId()));
        this.gsdcDeviceModel.setCellValueFactory((Callback)new PropertyValueFactory(this.gsdcDeviceModel.getId()));
        this.gsdcCheckRemarks.setCellValueFactory((Callback)new PropertyValueFactory(this.gsdcCheckRemarks.getId()));
        this.gsdcCheckResult.setCellValueFactory((Callback)new PropertyValueFactory(this.gsdcCheckResult.getId()));
        this.gsdcCheckStep.setCellValueFactory((Callback)new PropertyValueFactory(this.gsdcCheckStep.getId()));
        this.gsdcUpdateEmp.setCellValueFactory((Callback)new PropertyValueFactory(this.gsdcUpdateEmp.getId()));
        this.gsdcUpdateDate.setCellValueFactory((Callback)new PropertyValueFactory(this.gsdcUpdateDate.getId()));
        this.gsdcUpdateTime.setCellValueFactory((Callback)new PropertyValueFactory(this.gsdcUpdateTime.getId()));
        this.gsdcStatus.setCellValueFactory((Callback)new PropertyValueFactory(this.gsdcStatus.getId()));
        this.tableView.getSelectionModel().selectedItemProperty().addListener((ChangeListener)new ChangeListener<DeviceCheckOutData>(){

            public void changed(ObservableValue<? extends DeviceCheckOutData> observable, DeviceCheckOutData oldValue, DeviceCheckOutData newValue) {
                if (CollUtil.isEmpty((Collection)DeviceCheckController.this.observableTableList)) {
                    return;
                }
                for (int i = 0; i < DeviceCheckController.this.observableTableList.size(); ++i) {
                    if (i == newValue.getIndex() - 1) {
                        ((DeviceCheckOutData)DeviceCheckController.this.observableTableList.get(i)).getCheckBox().setSelectStatus(true);
                        continue;
                    }
                    ((DeviceCheckOutData)DeviceCheckController.this.observableTableList.get(i)).getCheckBox().setSelectStatus(false);
                }
            }
        });
    }

    private List<GsdcStatus> getAllStatus() {
        ArrayList<GsdcStatus> list = new ArrayList<GsdcStatus>();
        list.add(new GsdcStatus("1", "\u5df2\u5ba1\u6838"));
        list.add(new GsdcStatus("0", "\u672a\u5ba1\u6838"));
        return list;
    }

    private List<Integer> getSelectIndex() {
        ArrayList<Integer> ids = new ArrayList<Integer>();
        if (!CollectionUtils.isEmpty(this.observableTableList)) {
            for (DeviceCheckOutData i : this.observableTableList) {
                if (!i.getCheckBox().isSelected().booleanValue()) continue;
                ids.add(i.getIndex());
            }
        }
        return ids;
    }

    @FXML
    private void reset() {
        this.voucherIdQuery.clear();
        this.statusQuery.setValue(null);
        this.updateDateQuery.setValue(null);
    }

    public int getPageSize() {
        return this.pageSize;
    }

    public int getDefaultPageCount() {
        return this.defaultPageCount;
    }

    public ObservableList<DeviceCheckOutData> getObservableTableList() {
        return this.observableTableList;
    }

    public ScrollPane getScrollPane() {
        return this.scrollPane;
    }

    public VBox getVBox() {
        return this.vBox;
    }

    public TextField getVoucherIdQuery() {
        return this.voucherIdQuery;
    }

    public ChoiceBox<GsdcStatus> getStatusQuery() {
        return this.statusQuery;
    }

    public DatePicker getUpdateDateQuery() {
        return this.updateDateQuery;
    }

    public TableView<DeviceCheckOutData> getTableView() {
        return this.tableView;
    }

    public TableColumn<DeviceCheckOutData, CheckBox> getCheckBox() {
        return this.checkBox;
    }

    public TableColumn<DeviceCheckOutData, String> getIndex() {
        return this.index;
    }

    public TableColumn<DeviceCheckOutData, String> getGsdcVoucherId() {
        return this.gsdcVoucherId;
    }

    public TableColumn<DeviceCheckOutData, String> getGsdcBrId() {
        return this.gsdcBrId;
    }

    public TableColumn<DeviceCheckOutData, String> getGsdcBrName() {
        return this.gsdcBrName;
    }

    public TableColumn<DeviceCheckOutData, String> getGsdcDeviceId() {
        return this.gsdcDeviceId;
    }

    public TableColumn<DeviceCheckOutData, String> getGsdcDeviceName() {
        return this.gsdcDeviceName;
    }

    public TableColumn<DeviceCheckOutData, String> getGsdcDeviceModel() {
        return this.gsdcDeviceModel;
    }

    public TableColumn<DeviceCheckOutData, String> getGsdcCheckRemarks() {
        return this.gsdcCheckRemarks;
    }

    public TableColumn<DeviceCheckOutData, String> getGsdcCheckResult() {
        return this.gsdcCheckResult;
    }

    public TableColumn<DeviceCheckOutData, String> getGsdcCheckStep() {
        return this.gsdcCheckStep;
    }

    public TableColumn<DeviceCheckOutData, String> getGsdcUpdateEmp() {
        return this.gsdcUpdateEmp;
    }

    public TableColumn<DeviceCheckOutData, String> getGsdcUpdateDate() {
        return this.gsdcUpdateDate;
    }

    public TableColumn<DeviceCheckOutData, String> getGsdcUpdateTime() {
        return this.gsdcUpdateTime;
    }

    public TableColumn<DeviceCheckOutData, String> getGsdcStatus() {
        return this.gsdcStatus;
    }

    public Pagination getPagination() {
        return this.pagination;
    }

    public Insets getTableViewInsets() {
        return this.tableViewInsets;
    }

    public IndexController getIndexController() {
        return this.indexController;
    }

    public AddDeviceCheckController getAddDeviceCheckController() {
        return this.addDeviceCheckController;
    }

    public EditDeviceCheckController getEditDeviceCheckController() {
        return this.editDeviceCheckController;
    }

    public DeviceCheckOutData getSelectedCheckOutData() {
        return this.selectedCheckOutData;
    }

    public void setObservableTableList(ObservableList<DeviceCheckOutData> observableTableList) {
        this.observableTableList = observableTableList;
    }

    public void setScrollPane(ScrollPane scrollPane) {
        this.scrollPane = scrollPane;
    }

    public void setVBox(VBox vBox) {
        this.vBox = vBox;
    }

    public void setVoucherIdQuery(TextField voucherIdQuery) {
        this.voucherIdQuery = voucherIdQuery;
    }

    public void setStatusQuery(ChoiceBox<GsdcStatus> statusQuery) {
        this.statusQuery = statusQuery;
    }

    public void setUpdateDateQuery(DatePicker updateDateQuery) {
        this.updateDateQuery = updateDateQuery;
    }

    public void setTableView(TableView<DeviceCheckOutData> tableView) {
        this.tableView = tableView;
    }

    public void setCheckBox(TableColumn<DeviceCheckOutData, CheckBox> checkBox) {
        this.checkBox = checkBox;
    }

    public void setIndex(TableColumn<DeviceCheckOutData, String> index) {
        this.index = index;
    }

    public void setGsdcVoucherId(TableColumn<DeviceCheckOutData, String> gsdcVoucherId) {
        this.gsdcVoucherId = gsdcVoucherId;
    }

    public void setGsdcBrId(TableColumn<DeviceCheckOutData, String> gsdcBrId) {
        this.gsdcBrId = gsdcBrId;
    }

    public void setGsdcBrName(TableColumn<DeviceCheckOutData, String> gsdcBrName) {
        this.gsdcBrName = gsdcBrName;
    }

    public void setGsdcDeviceId(TableColumn<DeviceCheckOutData, String> gsdcDeviceId) {
        this.gsdcDeviceId = gsdcDeviceId;
    }

    public void setGsdcDeviceName(TableColumn<DeviceCheckOutData, String> gsdcDeviceName) {
        this.gsdcDeviceName = gsdcDeviceName;
    }

    public void setGsdcDeviceModel(TableColumn<DeviceCheckOutData, String> gsdcDeviceModel) {
        this.gsdcDeviceModel = gsdcDeviceModel;
    }

    public void setGsdcCheckRemarks(TableColumn<DeviceCheckOutData, String> gsdcCheckRemarks) {
        this.gsdcCheckRemarks = gsdcCheckRemarks;
    }

    public void setGsdcCheckResult(TableColumn<DeviceCheckOutData, String> gsdcCheckResult) {
        this.gsdcCheckResult = gsdcCheckResult;
    }

    public void setGsdcCheckStep(TableColumn<DeviceCheckOutData, String> gsdcCheckStep) {
        this.gsdcCheckStep = gsdcCheckStep;
    }

    public void setGsdcUpdateEmp(TableColumn<DeviceCheckOutData, String> gsdcUpdateEmp) {
        this.gsdcUpdateEmp = gsdcUpdateEmp;
    }

    public void setGsdcUpdateDate(TableColumn<DeviceCheckOutData, String> gsdcUpdateDate) {
        this.gsdcUpdateDate = gsdcUpdateDate;
    }

    public void setGsdcUpdateTime(TableColumn<DeviceCheckOutData, String> gsdcUpdateTime) {
        this.gsdcUpdateTime = gsdcUpdateTime;
    }

    public void setGsdcStatus(TableColumn<DeviceCheckOutData, String> gsdcStatus) {
        this.gsdcStatus = gsdcStatus;
    }

    public void setPagination(Pagination pagination) {
        this.pagination = pagination;
    }

    public void setTableViewInsets(Insets tableViewInsets) {
        this.tableViewInsets = tableViewInsets;
    }

    public void setIndexController(IndexController indexController) {
        this.indexController = indexController;
    }

    public void setAddDeviceCheckController(AddDeviceCheckController addDeviceCheckController) {
        this.addDeviceCheckController = addDeviceCheckController;
    }

    public void setEditDeviceCheckController(EditDeviceCheckController editDeviceCheckController) {
        this.editDeviceCheckController = editDeviceCheckController;
    }

    public void setSelectedCheckOutData(DeviceCheckOutData selectedCheckOutData) {
        this.selectedCheckOutData = selectedCheckOutData;
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof DeviceCheckController)) {
            return false;
        }
        DeviceCheckController other = (DeviceCheckController)o;
        if (!other.canEqual(this)) {
            return false;
        }
        if (this.getPageSize() != other.getPageSize()) {
            return false;
        }
        if (this.getDefaultPageCount() != other.getDefaultPageCount()) {
            return false;
        }
        ObservableList<DeviceCheckOutData> this$observableTableList = this.getObservableTableList();
        ObservableList<DeviceCheckOutData> other$observableTableList = other.getObservableTableList();
        if (this$observableTableList == null ? other$observableTableList != null : !this$observableTableList.equals(other$observableTableList)) {
            return false;
        }
        ScrollPane this$scrollPane = this.getScrollPane();
        ScrollPane other$scrollPane = other.getScrollPane();
        if (this$scrollPane == null ? other$scrollPane != null : !this$scrollPane.equals(other$scrollPane)) {
            return false;
        }
        VBox this$vBox = this.getVBox();
        VBox other$vBox = other.getVBox();
        if (this$vBox == null ? other$vBox != null : !this$vBox.equals(other$vBox)) {
            return false;
        }
        TextField this$voucherIdQuery = this.getVoucherIdQuery();
        TextField other$voucherIdQuery = other.getVoucherIdQuery();
        if (this$voucherIdQuery == null ? other$voucherIdQuery != null : !this$voucherIdQuery.equals(other$voucherIdQuery)) {
            return false;
        }
        ChoiceBox<GsdcStatus> this$statusQuery = this.getStatusQuery();
        ChoiceBox<GsdcStatus> other$statusQuery = other.getStatusQuery();
        if (this$statusQuery == null ? other$statusQuery != null : !this$statusQuery.equals(other$statusQuery)) {
            return false;
        }
        DatePicker this$updateDateQuery = this.getUpdateDateQuery();
        DatePicker other$updateDateQuery = other.getUpdateDateQuery();
        if (this$updateDateQuery == null ? other$updateDateQuery != null : !this$updateDateQuery.equals(other$updateDateQuery)) {
            return false;
        }
        TableView<DeviceCheckOutData> this$tableView = this.getTableView();
        TableView<DeviceCheckOutData> other$tableView = other.getTableView();
        if (this$tableView == null ? other$tableView != null : !this$tableView.equals(other$tableView)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, CheckBox> this$checkBox = this.getCheckBox();
        TableColumn<DeviceCheckOutData, CheckBox> other$checkBox = other.getCheckBox();
        if (this$checkBox == null ? other$checkBox != null : !this$checkBox.equals(other$checkBox)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, String> this$index = this.getIndex();
        TableColumn<DeviceCheckOutData, String> other$index = other.getIndex();
        if (this$index == null ? other$index != null : !this$index.equals(other$index)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, String> this$gsdcVoucherId = this.getGsdcVoucherId();
        TableColumn<DeviceCheckOutData, String> other$gsdcVoucherId = other.getGsdcVoucherId();
        if (this$gsdcVoucherId == null ? other$gsdcVoucherId != null : !this$gsdcVoucherId.equals(other$gsdcVoucherId)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, String> this$gsdcBrId = this.getGsdcBrId();
        TableColumn<DeviceCheckOutData, String> other$gsdcBrId = other.getGsdcBrId();
        if (this$gsdcBrId == null ? other$gsdcBrId != null : !this$gsdcBrId.equals(other$gsdcBrId)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, String> this$gsdcBrName = this.getGsdcBrName();
        TableColumn<DeviceCheckOutData, String> other$gsdcBrName = other.getGsdcBrName();
        if (this$gsdcBrName == null ? other$gsdcBrName != null : !this$gsdcBrName.equals(other$gsdcBrName)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, String> this$gsdcDeviceId = this.getGsdcDeviceId();
        TableColumn<DeviceCheckOutData, String> other$gsdcDeviceId = other.getGsdcDeviceId();
        if (this$gsdcDeviceId == null ? other$gsdcDeviceId != null : !this$gsdcDeviceId.equals(other$gsdcDeviceId)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, String> this$gsdcDeviceName = this.getGsdcDeviceName();
        TableColumn<DeviceCheckOutData, String> other$gsdcDeviceName = other.getGsdcDeviceName();
        if (this$gsdcDeviceName == null ? other$gsdcDeviceName != null : !this$gsdcDeviceName.equals(other$gsdcDeviceName)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, String> this$gsdcDeviceModel = this.getGsdcDeviceModel();
        TableColumn<DeviceCheckOutData, String> other$gsdcDeviceModel = other.getGsdcDeviceModel();
        if (this$gsdcDeviceModel == null ? other$gsdcDeviceModel != null : !this$gsdcDeviceModel.equals(other$gsdcDeviceModel)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, String> this$gsdcCheckRemarks = this.getGsdcCheckRemarks();
        TableColumn<DeviceCheckOutData, String> other$gsdcCheckRemarks = other.getGsdcCheckRemarks();
        if (this$gsdcCheckRemarks == null ? other$gsdcCheckRemarks != null : !this$gsdcCheckRemarks.equals(other$gsdcCheckRemarks)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, String> this$gsdcCheckResult = this.getGsdcCheckResult();
        TableColumn<DeviceCheckOutData, String> other$gsdcCheckResult = other.getGsdcCheckResult();
        if (this$gsdcCheckResult == null ? other$gsdcCheckResult != null : !this$gsdcCheckResult.equals(other$gsdcCheckResult)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, String> this$gsdcCheckStep = this.getGsdcCheckStep();
        TableColumn<DeviceCheckOutData, String> other$gsdcCheckStep = other.getGsdcCheckStep();
        if (this$gsdcCheckStep == null ? other$gsdcCheckStep != null : !this$gsdcCheckStep.equals(other$gsdcCheckStep)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, String> this$gsdcUpdateEmp = this.getGsdcUpdateEmp();
        TableColumn<DeviceCheckOutData, String> other$gsdcUpdateEmp = other.getGsdcUpdateEmp();
        if (this$gsdcUpdateEmp == null ? other$gsdcUpdateEmp != null : !this$gsdcUpdateEmp.equals(other$gsdcUpdateEmp)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, String> this$gsdcUpdateDate = this.getGsdcUpdateDate();
        TableColumn<DeviceCheckOutData, String> other$gsdcUpdateDate = other.getGsdcUpdateDate();
        if (this$gsdcUpdateDate == null ? other$gsdcUpdateDate != null : !this$gsdcUpdateDate.equals(other$gsdcUpdateDate)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, String> this$gsdcUpdateTime = this.getGsdcUpdateTime();
        TableColumn<DeviceCheckOutData, String> other$gsdcUpdateTime = other.getGsdcUpdateTime();
        if (this$gsdcUpdateTime == null ? other$gsdcUpdateTime != null : !this$gsdcUpdateTime.equals(other$gsdcUpdateTime)) {
            return false;
        }
        TableColumn<DeviceCheckOutData, String> this$gsdcStatus = this.getGsdcStatus();
        TableColumn<DeviceCheckOutData, String> other$gsdcStatus = other.getGsdcStatus();
        if (this$gsdcStatus == null ? other$gsdcStatus != null : !this$gsdcStatus.equals(other$gsdcStatus)) {
            return false;
        }
        Pagination this$pagination = this.getPagination();
        Pagination other$pagination = other.getPagination();
        if (this$pagination == null ? other$pagination != null : !this$pagination.equals(other$pagination)) {
            return false;
        }
        Insets this$tableViewInsets = this.getTableViewInsets();
        Insets other$tableViewInsets = other.getTableViewInsets();
        if (this$tableViewInsets == null ? other$tableViewInsets != null : !this$tableViewInsets.equals(other$tableViewInsets)) {
            return false;
        }
        IndexController this$indexController = this.getIndexController();
        IndexController other$indexController = other.getIndexController();
        if (this$indexController == null ? other$indexController != null : !(this$indexController).equals(other$indexController)) {
            return false;
        }
        AddDeviceCheckController this$addDeviceCheckController = this.getAddDeviceCheckController();
        AddDeviceCheckController other$addDeviceCheckController = other.getAddDeviceCheckController();
        if (this$addDeviceCheckController == null ? other$addDeviceCheckController != null : !this$addDeviceCheckController.equals(other$addDeviceCheckController)) {
            return false;
        }
        EditDeviceCheckController this$editDeviceCheckController = this.getEditDeviceCheckController();
        EditDeviceCheckController other$editDeviceCheckController = other.getEditDeviceCheckController();
        if (this$editDeviceCheckController == null ? other$editDeviceCheckController != null : !this$editDeviceCheckController.equals(other$editDeviceCheckController)) {
            return false;
        }
        DeviceCheckOutData this$selectedCheckOutData = this.getSelectedCheckOutData();
        DeviceCheckOutData other$selectedCheckOutData = other.getSelectedCheckOutData();
        return !(this$selectedCheckOutData == null ? other$selectedCheckOutData != null : !(this$selectedCheckOutData).equals(other$selectedCheckOutData));
    }

    protected boolean canEqual(Object other) {
        return other instanceof DeviceCheckController;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        result = result * 59 + this.getPageSize();
        result = result * 59 + this.getDefaultPageCount();
        ObservableList<DeviceCheckOutData> $observableTableList = this.getObservableTableList();
        result = result * 59 + ($observableTableList == null ? 43 : $observableTableList.hashCode());
        ScrollPane $scrollPane = this.getScrollPane();
        result = result * 59 + ($scrollPane == null ? 43 : $scrollPane.hashCode());
        VBox $vBox = this.getVBox();
        result = result * 59 + ($vBox == null ? 43 : $vBox.hashCode());
        TextField $voucherIdQuery = this.getVoucherIdQuery();
        result = result * 59 + ($voucherIdQuery == null ? 43 : $voucherIdQuery.hashCode());
        ChoiceBox<GsdcStatus> $statusQuery = this.getStatusQuery();
        result = result * 59 + ($statusQuery == null ? 43 : $statusQuery.hashCode());
        DatePicker $updateDateQuery = this.getUpdateDateQuery();
        result = result * 59 + ($updateDateQuery == null ? 43 : $updateDateQuery.hashCode());
        TableView<DeviceCheckOutData> $tableView = this.getTableView();
        result = result * 59 + ($tableView == null ? 43 : $tableView.hashCode());
        TableColumn<DeviceCheckOutData, CheckBox> $checkBox = this.getCheckBox();
        result = result * 59 + ($checkBox == null ? 43 : $checkBox.hashCode());
        TableColumn<DeviceCheckOutData, String> $index = this.getIndex();
        result = result * 59 + ($index == null ? 43 : $index.hashCode());
        TableColumn<DeviceCheckOutData, String> $gsdcVoucherId = this.getGsdcVoucherId();
        result = result * 59 + ($gsdcVoucherId == null ? 43 : $gsdcVoucherId.hashCode());
        TableColumn<DeviceCheckOutData, String> $gsdcBrId = this.getGsdcBrId();
        result = result * 59 + ($gsdcBrId == null ? 43 : $gsdcBrId.hashCode());
        TableColumn<DeviceCheckOutData, String> $gsdcBrName = this.getGsdcBrName();
        result = result * 59 + ($gsdcBrName == null ? 43 : $gsdcBrName.hashCode());
        TableColumn<DeviceCheckOutData, String> $gsdcDeviceId = this.getGsdcDeviceId();
        result = result * 59 + ($gsdcDeviceId == null ? 43 : $gsdcDeviceId.hashCode());
        TableColumn<DeviceCheckOutData, String> $gsdcDeviceName = this.getGsdcDeviceName();
        result = result * 59 + ($gsdcDeviceName == null ? 43 : $gsdcDeviceName.hashCode());
        TableColumn<DeviceCheckOutData, String> $gsdcDeviceModel = this.getGsdcDeviceModel();
        result = result * 59 + ($gsdcDeviceModel == null ? 43 : $gsdcDeviceModel.hashCode());
        TableColumn<DeviceCheckOutData, String> $gsdcCheckRemarks = this.getGsdcCheckRemarks();
        result = result * 59 + ($gsdcCheckRemarks == null ? 43 : $gsdcCheckRemarks.hashCode());
        TableColumn<DeviceCheckOutData, String> $gsdcCheckResult = this.getGsdcCheckResult();
        result = result * 59 + ($gsdcCheckResult == null ? 43 : $gsdcCheckResult.hashCode());
        TableColumn<DeviceCheckOutData, String> $gsdcCheckStep = this.getGsdcCheckStep();
        result = result * 59 + ($gsdcCheckStep == null ? 43 : $gsdcCheckStep.hashCode());
        TableColumn<DeviceCheckOutData, String> $gsdcUpdateEmp = this.getGsdcUpdateEmp();
        result = result * 59 + ($gsdcUpdateEmp == null ? 43 : $gsdcUpdateEmp.hashCode());
        TableColumn<DeviceCheckOutData, String> $gsdcUpdateDate = this.getGsdcUpdateDate();
        result = result * 59 + ($gsdcUpdateDate == null ? 43 : $gsdcUpdateDate.hashCode());
        TableColumn<DeviceCheckOutData, String> $gsdcUpdateTime = this.getGsdcUpdateTime();
        result = result * 59 + ($gsdcUpdateTime == null ? 43 : $gsdcUpdateTime.hashCode());
        TableColumn<DeviceCheckOutData, String> $gsdcStatus = this.getGsdcStatus();
        result = result * 59 + ($gsdcStatus == null ? 43 : $gsdcStatus.hashCode());
        Pagination $pagination = this.getPagination();
        result = result * 59 + ($pagination == null ? 43 : $pagination.hashCode());
        Insets $tableViewInsets = this.getTableViewInsets();
        result = result * 59 + ($tableViewInsets == null ? 43 : $tableViewInsets.hashCode());
        IndexController $indexController = this.getIndexController();
        result = result * 59 + ($indexController == null ? 43 : ($indexController).hashCode());
        AddDeviceCheckController $addDeviceCheckController = this.getAddDeviceCheckController();
        result = result * 59 + ($addDeviceCheckController == null ? 43 : $addDeviceCheckController.hashCode());
        EditDeviceCheckController $editDeviceCheckController = this.getEditDeviceCheckController();
        result = result * 59 + ($editDeviceCheckController == null ? 43 : $editDeviceCheckController.hashCode());
        DeviceCheckOutData $selectedCheckOutData = this.getSelectedCheckOutData();
        result = result * 59 + ($selectedCheckOutData == null ? 43 : ($selectedCheckOutData).hashCode());
        return result;
    }

    public String toString() {
        return "DeviceCheckController(pageSize=" + this.getPageSize() + ", defaultPageCount=" + this.getDefaultPageCount() + ", observableTableList=" + this.getObservableTableList() + ", scrollPane=" + this.getScrollPane() + ", vBox=" + this.getVBox() + ", voucherIdQuery=" + this.getVoucherIdQuery() + ", statusQuery=" + this.getStatusQuery() + ", updateDateQuery=" + this.getUpdateDateQuery() + ", tableView=" + this.getTableView() + ", checkBox=" + this.getCheckBox() + ", index=" + this.getIndex() + ", gsdcVoucherId=" + this.getGsdcVoucherId() + ", gsdcBrId=" + this.getGsdcBrId() + ", gsdcBrName=" + this.getGsdcBrName() + ", gsdcDeviceId=" + this.getGsdcDeviceId() + ", gsdcDeviceName=" + this.getGsdcDeviceName() + ", gsdcDeviceModel=" + this.getGsdcDeviceModel() + ", gsdcCheckRemarks=" + this.getGsdcCheckRemarks() + ", gsdcCheckResult=" + this.getGsdcCheckResult() + ", gsdcCheckStep=" + this.getGsdcCheckStep() + ", gsdcUpdateEmp=" + this.getGsdcUpdateEmp() + ", gsdcUpdateDate=" + this.getGsdcUpdateDate() + ", gsdcUpdateTime=" + this.getGsdcUpdateTime() + ", gsdcStatus=" + this.getGsdcStatus() + ", pagination=" + this.getPagination() + ", tableViewInsets=" + this.getTableViewInsets() + ", indexController=" + this.getIndexController() + ", addDeviceCheckController=" + this.getAddDeviceCheckController() + ", editDeviceCheckController=" + this.getEditDeviceCheckController() + ", selectedCheckOutData=" + this.getSelectedCheckOutData() + ")";
    }
}

